package com.zkzx.common.freight.constants;


import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum OrderStatusEnum {


    NO_SUBMIT(0,"未提交"),

    APPROVE_WAIT(-1," 待平台审验"),

    VERIFY_SUCCESS(999,"审核完成"),

    PLATFORM_REJECT(-2,"平台驳回"),

    PAY_WAIT(-3,"待支付"),

    PAY_ING(-4,"支付中"),

    BILL_VOID(-5,"运单已作废"),

    PAY_INVOICE(-6,"已支付，待开发票"),

    INVOICING(-7,"开票中"),

    NO_INVOICED(1,"不可开票"),

    CAN_INVOICING(2,"可开票"),

    INVOICED(3,"已开票");


    private int value;

    private String description;

    public static OrderStatusEnum get(int id){
        return Arrays.stream(OrderStatusEnum.values()).filter(order -> order.value == id).findFirst().orElse(null);
    }


}
